LOCAL_PATH := $(call my-dir)



# Module : native.renderer ------------#
include $(CLEAR_VARS)
LOCAL_MODULE := native.renderer
NeHe_ES   	 := NeHe.ES

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC  := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels

#OPTS := -O2 -ffast-math -fexpensive-optimizations \
# -funroll-loops -fomit-frame-pointer -fsigned-char -g
# -fshort-wchar
# -fno-signed-char
# -fno_unsigned-char
#LOCAL_CPPFLAGS := -Wall
#-Wno-write-strings

LOCAL_CFLAGS := $(INC) $(OPTS) -DTARGET_POSIX

LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_C_INCLUDES := $(STLPORT_BASE)/stlport

# overwrite RANLIB set in linux.mk
#export RANLIB = arm-linux-ranlib
# -lranlib

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static -liPhone3D.Programming.android.common

#-lstdc++ #-lcutils -lgpstest
#-liPhone3D.Programming.android.common

TARGET_PLATFORM := android-8

LOCAL_STATIC_LIBRARIES := NeHe.ES.lesson glues.PanoramaGL glbmp-1.1 Common \
						  iPhone3D.Programming.android.common \
						  iPhone3D.Programming.SimpleWireframe \
						  iPhone3D.Programming.VertexLighting \

#						  iPhone3D.Programming.FancyWireframe \
#						  iPhone3D.Programming.ObjViewer \

LOCAL_SRC_FILES := \
	common_def.cpp \
	NativeRenderer.cpp \

LOCAL_SRC_FILES += \
	importgl.c \

#LOCAL_SHARED_LIBRARIES := libcutils
#LOCAL_STATIC_LIBRARIES := libgpstest

include $(BUILD_SHARED_LIBRARY)



# Module : NeHe.ES.lesson ------------#

include  $(CLEAR_VARS)
LOCAL_MODULE := glbmp-1.1
GLBMP   	 := glbmp-1.1

STLPORT_BASE := $(LOCAL_PATH)/stlport_android

INC := -Icommon_def.h
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(GLBMP)/glbmp.c


include $(BUILD_STATIC_LIBRARY)



# Module : NeHe.ES.lesson ------------#

include  $(CLEAR_VARS)
LOCAL_MODULE := NeHe.ES.lesson
NeHe_ES   	 := NeHe.ES

STLPORT_BASE := $(LOCAL_PATH)/stlport_android

INC := -Icommon_def.h -Ilesson.h
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

#LOCAL_STATIC_LIBRARIES := glues.PanoramaGL

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(NeHe_ES)/lesson02/lesson02.cpp \
		$(NeHe_ES)/lesson03/lesson03.cpp \
		$(NeHe_ES)/lesson04/lesson04.cpp \
		$(NeHe_ES)/lesson05/lesson05.cpp \
		$(NeHe_ES)/lesson06/lesson06.cpp \
		$(NeHe_ES)/lesson07/lesson07.cpp \
		$(NeHe_ES)/lesson08/lesson08.cpp \


include $(BUILD_STATIC_LIBRARY)


# Module : PanoramaGL ------------#

include  $(CLEAR_VARS)
LOCAL_MODULE := glues.PanoramaGL
PanoramaGL	 := PanoramaGL

STLPORT_BASE := $(LOCAL_PATH)/stlport_android

INC := -Icommon_def.h -Ilesson.h
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static


TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(PanoramaGL)/glues_error.c \
		$(PanoramaGL)/glues_mipmap.c \
		$(PanoramaGL)/glues_project.c \
		$(PanoramaGL)/glues_quad.c \
		$(PanoramaGL)/glues_registry.c


include $(BUILD_STATIC_LIBRARY)


# Module : Common ------------#

include  $(CLEAR_VARS)
LOCAL_MODULE := Common

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL
# -DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\

include $(BUILD_STATIC_LIBRARY)

# Module : iPhone3D.Programming.android.common

include  $(CLEAR_VARS)
LOCAL_MODULE := iPhone3D.Programming.android.common

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		iPhone3D.Programming/android/common/ParametricSurface.cpp

include $(BUILD_STATIC_LIBRARY)


# Module : iPhone3D.Programming.SimpleWireframe

include  $(CLEAR_VARS)
LOCAL_MODULE := iPhone3D.Programming.SimpleWireframe
SIMPLE_WIREFRAME := iPhone3D.Programming/SimpleWireframe

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

#LOCAL_STATIC_LIBRARIES := iPhone3D.Programming.android.common

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(SIMPLE_WIREFRAME)/Classes/ApplicationEngine.cpp \
		$(SIMPLE_WIREFRAME)/Classes/RenderingEngine.ES1.cpp \
#		$(SIMPLE_WIREFRAME)/Classes/ParametricSurface.cpp


include $(BUILD_STATIC_LIBRARY)


# Module : iPhone3D.Programming.VertexLighting

include  $(CLEAR_VARS)
LOCAL_MODULE := iPhone3D.Programming.VertexLighting
VERTEX_LIGHTING := iPhone3D.Programming/VertexLighting

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

LOCAL_STATIC_LIBRARIES := iPhone3D.Programming.android.common

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(VERTEX_LIGHTING)/Classes/ApplicationEngine.cpp \
		$(VERTEX_LIGHTING)/Classes/RenderingEngine.ES1.cpp \
#		$(VERTEX_LIGHTING)/Classes/ParametricSurface.ObjViewer.cpp


include $(BUILD_STATIC_LIBRARY)


# Module : iPhone3D.Programming.FancyWireframe

include  $(CLEAR_VARS)
LOCAL_MODULE := iPhone3D.Programming.FancyWireframe
FANCY_WIREFRAME := iPhone3D.Programming/FancyWireframe

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

LOCAL_STATIC_LIBRARIES := iPhone3D.Programming.android.common

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(FANCY_WIREFRAME)/Classes/ApplicationEngine.cpp \
		$(FANCY_WIREFRAME)/Classes/RenderingEngine.ES1.cpp \
#		$(FANCY_WIREFRAME)/Classes/ParametricSurface.ObjViewer.cpp


include $(BUILD_STATIC_LIBRARY)


# Module : iPhone3D.Programming.ObjViewer

include  $(CLEAR_VARS)
LOCAL_MODULE := iPhone3D.Programming.ObjViewer
OBJ_VIEWER := iPhone3D.Programming/ObjViewer

STLPORT_BASE := $(LOCAL_PATH)/stlport_android
ANDROID_COMMON := $(LOCAL_PATH)/iPhone3D.Programming/android/common

INC := -Icommon_def.h -Ilesson.h -I$(STLPORT_BASE)/stlport -I$(ANDROID_COMMON)
OPTS := -fsigned-char -Wno-write-strings -Wno-endif-labels
LOCAL_CFLAGS := $(INC) $(OPTS)
LOCAL_CFLAGS += \
		-DANDROID \
		-DOS_ANDROID \
		-DPLATFORM_ANDROID \
		-DANDROID_NDK \
		-DDISABLE_IMPORTGL \
		-DDEBUG_ANDROID

LOCAL_LDLIBS := -lGLESv1_CM -lc -llog \
				-L$(LOCAL_PATH)/../obj/local/armeabi -lstlport_static

LOCAL_STATIC_LIBRARIES := iPhone3D.Programming.android.common

TARGET_PLATFORM := android-8

LOCAL_SRC_FILES :=	\
		$(OBJ_VIEWER)/Classes/ApplicationEngine.cpp \
		$(OBJ_VIEWER)/Classes/RenderingEngine.ES1.cpp \
#		$(OBJ_VIEWER)/Classes/ParametricSurface.ObjViewer.cpp


include $(BUILD_STATIC_LIBRARY)


